popover: Avoid a crash when no relative-to widget is set
authorMatthias Clasen <mclasen@redhat.com>
Wed, 18 Nov 2015 03:48:35 +0000 (22:48 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 18 Nov 2015 03:48:35 +0000 (22:48 -0500)
This was showing up in glade, which creates freestanding
popovers.

gtk/gtkpopover.c

index cce113f6a11ce89bf243ccce827cb3f27352f54b..8a56db06f3f67e45df01c6c2dc8295550570d272 100644 (file)
@@ -1370,6 +1370,9 @@ gtk_popover_check_invalidate_borders (GtkPopover *popover)
   GtkPositionType gap_side;
   gint tip_x, tip_y;
 
+  if (!priv->widget)
+    return;
+
   gtk_popover_get_gap_coords (popover, NULL, NULL,
                               &tip_x, &tip_y, NULL, NULL,
                               &gap_side);